import 'dart:async';

import 'package:get/get.dart';
import 'package:wan_android_flutter/common/base/base_controller.dart';

import '../../common/routes/route_manager.dart';
import 'splash_state.dart';

class SplashLogic extends BaseController {
  final SplashState state = SplashState();

  Timer? _timer;

  @override
  void onInit() {
    super.onInit();
    _timer = Timer(const Duration(seconds: 3), () {
      Get.offAndToNamed(RouteManager.mainPage);
    });
  }

  @override
  void onDetached() {
    _timer?.cancel();
    super.onDetached();
  }
}
